package com.sgb.kjwl.view.ui.adapter.self.goods;

import android.content.Context;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;

import com.sgb.kjwl.BR;
import com.sgb.kjwl.R;
import com.sgb.kjwl.databinding.ItemOperationRecodZBinding;
import com.sgb.kjwl.model.entity.MemberPriceEntity;
import com.sgb.kjwl.model.entity.user.OperationRecordItemSkuEntity;
import com.sgb.kjwl.view.ui.adapter.map.BaseRecycleAdapter;
import com.sgb.kjwl.view.ui.adapter.map.ItemViewHolder;
import com.swgk.core.customview.ItemInputTextView;

import java.util.List;

public class OperationRecodSonAdpater extends BaseRecycleAdapter<MemberPriceEntity.SkuMemberPriceList> {
    public OperationRecodSonAdpater(Context context, List<MemberPriceEntity.SkuMemberPriceList> datas) {
        super(context, R.layout.item_operation_recod_z, datas);
    }

    @Override
    public void convert(ItemViewHolder holder, MemberPriceEntity.SkuMemberPriceList s) {
        holder.getmBinding().setVariable(BR.model, s);
        if (holder.getmBinding() instanceof ItemOperationRecodZBinding) {
            ((ItemOperationRecodZBinding) holder.getmBinding()).line.setVisibility(holder.getAdapterPosition() == datas.size() - 1 ? View.GONE : View.VISIBLE);
            ((ItemOperationRecodZBinding) holder.getmBinding()).tvName.setText(s.getSkuDetails());
            ((ItemOperationRecodZBinding) holder.getmBinding()).rl.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    if (onItemClick != null) {
                        onItemClick.onItemClick(s, holder.getPosition());
                    }
                }
            });
        }
    }
}
